package cn.zl.web.dto.streamproxy;

import cn.yunbamboos.rest.service.anno.param.ParamType;
import cn.yunbamboos.rest.service.anno.param.enums.Type;
import cn.yunbamboos.rest.service.dto.in.GenericInDTO;
import cn.zl.model.StreamProxy;
import com.alibaba.fastjson2.JSONObject;
import jakarta.validation.constraints.NotNull;

public class UpdateStreamProxyInDTO extends GenericInDTO {

    @NotNull(message = "拉流信息不能为空")
    @ParamType(path = "stream_proxy", type = Type.Object)
    private StreamProxy streamProxy;

    @Override
    public void decode(JSONObject json) {
        super.decode(json);
        this.streamProxy = this.getModel(json, "stream_proxy", StreamProxy.class);
    }

    /**
     * 获取参数拉流信息
     *
     * @return {@link StreamProxy} 拉流信息信息封装
     */
    public StreamProxy getStreamProxy() {
        return streamProxy;
    }

}
